import utils from '../utils/index.js'
const {
	clone
} = utils

export default class Basics {

	constructor() {}

	fill(source = {}, map = []) {
		const cloner = clone(this)
		const preMap = this.map() || map
		for (let i in cloner) {
			const tar = new Map(preMap).get(i)
			const tars = tar.split('.')
			const sourceV = tars.reduce((pre, item) => {
				return pre[item]
			}, source)
			this[i] = sourceV || ''
		}
	}
}
